/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dchapman
 */
@Entity
@Table(name = "posLoyaltyPoints")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "posLoyaltyPoints.findAll", query = "SELECT p FROM PosLoyaltyPoints p"),
    @NamedQuery(name = "posLoyaltyPoints.findByLpID", query = "SELECT p FROM PosLoyaltyPoints p WHERE p.lpID = :lpID"),
    @NamedQuery(name = "posLoyaltyPoints.findByLpDescription", query = "SELECT p FROM PosLoyaltyPoints p WHERE p.lpDescription = :lpDescription"),
    @NamedQuery(name = "posLoyaltyPoints.findByLpPoints", query = "SELECT p FROM PosLoyaltyPoints p WHERE p.lpPoints = :lpPoints"),
    @NamedQuery(name = "posLoyaltyPoints.findByLpValue", query = "SELECT p FROM PosLoyaltyPoints p WHERE p.lpValue = :lpValue")})
public class PosLoyaltyPoints implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "lpID")
    private Integer lpID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 250)
    @Column(name = "lpDescription")
    private String lpDescription;
    @Basic(optional = false)
    @NotNull
    @Column(name = "lpPoints")
    private int lpPoints;
    @Basic(optional = false)
    @NotNull
    @Column(name = "lpValue")
    private float lpValue;

    public PosLoyaltyPoints() {
    }

    public PosLoyaltyPoints(Integer lpID) {
        this.lpID = lpID;
    }

    public PosLoyaltyPoints(Integer lpID, String lpDescription, int lpPoints, float lpValue) {
        this.lpID = lpID;
        this.lpDescription = lpDescription;
        this.lpPoints = lpPoints;
        this.lpValue = lpValue;
    }

    public Integer getLpID() {
        return lpID;
    }

    public void setLpID(Integer lpID) {
        this.lpID = lpID;
    }

    public String getLpDescription() {
        return lpDescription;
    }

    public void setLpDescription(String lpDescription) {
        this.lpDescription = lpDescription;
    }

    public int getLpPoints() {
        return lpPoints;
    }

    public void setLpPoints(int lpPoints) {
        this.lpPoints = lpPoints;
    }

    public float getLpValue() {
        return lpValue;
    }

    public void setLpValue(float lpValue) {
        this.lpValue = lpValue;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (lpID != null ? lpID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosLoyaltyPoints)) {
            return false;
        }
        PosLoyaltyPoints other = (PosLoyaltyPoints) object;
        if ((this.lpID == null && other.lpID != null) || (this.lpID != null && !this.lpID.equals(other.lpID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.PosLoyaltyPoints[ lpID=" + lpID + " ]";
    }
    
}
